The present disclosure relates to embedded systems, and more particularly, to methods and apparatus for executing the boot code of embedded systems.
An embedded system is generally manufactured for a specified purpose. Such a system typically includes a central processing unit (CPU), memory, and software including “boot code”. The boot code initializes the memory and CPU registers, and instructs the initial operation of the CPU.
Generally, the boot code may be written to read-only memory (ROM) when the system is manufactured, and supplied to the customer with the system. Unfortunately, if a slight change in the boot code is desired, the ROM needs to be exchanged because the ROM cannot be modified. In addition, some customers may want to use their own boot code for initializing the system, such as to resolve security issues.
Recently, the boot code has been more frequently stored in non-volatile memory (NVM), such as EEPROM and/or Flash memory, instead of ROM. Although this use of NVM may permit customers to customize the boot code, it has several inherent problems. For example, an error during Flash reprogramming, where the original boot code is intended to be overwritten with customized boot code, may cause the embedded system to become unbootable.
FIG. 1 shows a conventional apparatus for executing the boot code of an embedded system, which is indicated generally by the reference numeral 100. The apparatus 100 includes a CPU 110, an address decoder 120 connected to the CPU, and a Flash memory 130 connected to the decoder.
If a manufacturer stores the boot code and basic library functions in a Flash memory such as 130, the system is initially booted by the boot code provided by the manufacturer. After initial booting, a customer might erase all or part of the boot code and rewrite or reprogram new boot code, such as by using manufacturer-provided basic library functions. Thereafter, the system should normally be capable of booting with the new boot code. Unfortunately, during the process of erasing the old boot code, the flash memory is liable to be damaged. When this happens, the system may not operate properly or may not boot at all due to the destruction of the boot code.